﻿using ARchGL.Platform.Core;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace ARchGL.Platform.Core
{
    /// <summary>
    /// 千变_环境监测信息
    /// </summary>
    [Table(nameof(QB_ProjectEnvironments))]
    public class QB_ProjectEnvironments : QianbianEntityBase
    {
        /// <summary>
        /// 项目标识
        /// </summary>
        public Guid ProjectId { get; set; }

        /// <summary>
        /// 设备序列号
        /// </summary>
        [MaxLength(50)]
        public string SerialNumber { get; set; }

        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime RecordTime { get; set; }

        /// <summary>
        /// 温度
        /// </summary>
        [MaxLength(100)]
        public string TemperatureTag { get; set; }

        /// <summary>
        /// 湿度
        /// </summary>
        [MaxLength(100)]
        public string HumidityTag { get; set; }

        /// <summary>
        /// PM2.5
        /// </summary>
        [MaxLength(100)]
        public string Pm2p5Tag { get; set; }

        /// <summary>
        /// pm10
        /// </summary>
        [MaxLength(100)]
        public string Pm10Tag { get; set; }

        /// <summary>
        /// 噪音
        /// </summary>
        [MaxLength(100)]
        public string NoiseTag { get; set; }

        /// <summary>
        /// 风速
        /// </summary>
        [MaxLength(100)]
        public string WindSpeedTag { get; set; }

        /// <summary>
        /// 根据类型获取对应数据
        /// </summary>
        /// <param name="type">数据类型：1温度、2湿度、3PM2.5、4PM10、5噪音、6风速</param>
        /// <returns></returns>
        public string GetDataByType(int type)
        {
            switch (type)
            {
                case 1: return TemperatureTag;
                case 2: return HumidityTag;
                case 3: return Pm2p5Tag;
                case 4: return Pm10Tag;
                case 5: return NoiseTag;
                case 6: return WindSpeedTag;
                default: return TemperatureTag;
            }
        }
    }
}
